#pragma once

#include <linux/types.h>
#include <asm/page.h> /* I/O is all done through memory accesses */

#ifndef __raw_readl
#define __raw_readl __raw_readl
static inline uint32_t __raw_readl(const volatile void *addr)
{
	return *(const volatile uint32_t *)addr;
}
#endif

#ifndef __raw_writel
#define __raw_writel __raw_writel
static inline void __raw_writel(uint32_t value, volatile void *addr)
{
	*(volatile uint32_t *)addr = value;
}
#endif

#ifndef phys_to_virt
#define phys_to_virt phys_to_virt
static inline void *phys_to_virt(unsigned long address)
{
	return __va(address);
}
#endif

#ifdef CONFIG_MMU
void *generic_ioremap_prot(phys_addr_t phys_addr, size_t size,
						   pgprot_t prot);

#endif
